/*
 * RangeFinder_Switch.c
 *
 *  Created on: 07/03/2013
 *      Author: Bowmer
 */

#include "T0.h"
#include "T1.h"
#include "T2.h"
#include "T3.h"


extern volatile unsigned int T1ReceiveIndex;
extern volatile unsigned int T2ReceiveIndex;
extern volatile unsigned int T3ReceiveIndex;
extern volatile unsigned int T0ReceiveIndex;
extern volatile unsigned int T1PrevIndex;
extern volatile unsigned int T2PrevIndex;
extern volatile unsigned int T3PrevIndex;
extern volatile unsigned int T0PrevIndex;


void Call_Rangefinder(unsigned int rangeFinderIndex){

	switch(rangeFinderIndex){

	case 0:
		T1ReceiveIndex = 0;
		T1PrevIndex = 1;
		Timer1_Pulse();
		break;

	case 1:
		T2ReceiveIndex = 0;
		T2PrevIndex = 1;
		Timer2_Pulse();
		break;

	case 2:
		T3ReceiveIndex = 0;
		T3PrevIndex = 1;
		Timer3_Pulse();
		break;

	case 3:
		T0ReceiveIndex = 0;
		T0PrevIndex = 1;
		Timer0_Pulse();
		break;

	}


}
